package com.xinzhi.controller;

import com.xinzhi.pojo.dto.LoginRequest;
import com.xinzhi.service.IPhoAndPwdLoginService;
import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户根据手机号和密码登录的控制层
 */
@RestController
public class PhoAndPwdLoginController {
    @Autowired
    private IPhoAndPwdLoginService userService;

    /**
     * 用户根据手机号和密码登录接口
     * @param loginRequest 登录请求参数
     * @return
     */
    @PostMapping("ByPhoAndPwd")
    public Result loginByPhoAndPwd(@RequestBody LoginRequest loginRequest){
        return userService.LoginByPwdAndPho(loginRequest);
    }
}
